package com.hibiscusking.pet.service.impl;

import com.hibiscusking.pet.domain.Pet;
import com.hibiscusking.pet.domain.PetDetail;
import com.hibiscusking.pet.domain.PetType;
import com.hibiscusking.pet.mapper.PetDetailMapper;
import com.hibiscusking.pet.mapper.PetMapper;
import com.hibiscusking.pet.service.IPetService;
import com.hibiscusking.basic.service.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author hibiscusking
 * @since 2022-10-28
 */
@Service
public class PetServiceImpl extends BaseServiceImpl<Pet> implements IPetService {
    @Autowired
    PetDetailMapper petDetailMapper;
    @Override
    public void add(Pet pet) {
        super.add(pet);
        // 添加详细信息
        pet.getDetail().setPetId(pet.getId());
        petDetailMapper.add(pet.getDetail());
    }
}
